<fly:block name="refill_pagination_search">
	<div id="refill-pagination"></div>
</fly:block>
<fly:block name="pagination_search">
	<div class="clear"></div>
	<div class="pagination_block">
		<div id="pagination_bottom" class="pagination pagination_number"></div>
		<div class="search">
			<form method="post">
			<span id="search"></span>&nbsp;<input class="text title_debug" type="textbox" name="title_debug" id="title_debug_bottom"  size="30"/>
			</form>			
			<div class="clear"></div>	
			<div class="ajax_loading ajax_loading_bottom"></div>
		</div>
	</div>
	<div class="clear"></div>
</fly:block>
<script type="text/javascript">
$("#search").text(text_title);
$("#pagination_bottom").pagination(num_items, {
			items_per_page: items_per_page,
			num_edge_entries: 3,
			num_display_entries: num_display_entries,
			current_page: current_page,
			callback: pageselectCallbackBottom
		});
function pageselectCallbackBottom(page_id){
		var limit = (page_id*items_per_page)+" , "+items_per_page;
		$("#ajax_loading").show();
		title_debug_2 = $('#title_debug_bottom').val()==title_debug_default?'':$('#title_debug_bottom').val();
		if (timeout) clearTimeout(timeout);
		timeout = setTimeout(function(){
						$("#item_list").html($.ajax({
	                        url: '<fly:variable name="rep_ajax" /><fly:variable name="rep_item_lister" />',
	                        type: "POST",
	                		data: "limit="+limit+"&id_type="+$('#id_news_type').val()+"&title_debug="+title_debug_2+"&orderBy="+(orderBY?orderBY:''),
	                		async: false,
	                		error: function(){
						        return 'Please try again!';
						    },
						    complete: function(){
						    	$("#pagination_top").pagination(num_items, {
									items_per_page: items_per_page,
									num_edge_entries: 3,
									num_display_entries: num_display_entries,
									current_page: page_id,				
		            				callback: pageselectCallbackTop
								});
				    			$(".ajax_loading").hide();
						    }
	                    }).responseText);
				}, delay_one_mili_second);
	
}
</script>